import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;

public final class be extends ba {
	public az a;
	public az b;
	public az c;

	public be(aj aj1) {
		super(bh.a("options"));
		H = aj1;
	}

	public final boolean b(int i) {
		aj aj1 = (aj) H;
		ba ba1 = aj1.b;
		k k1 = aj1.c;

		if (k1 != null) {
			az az1 = null;
			boolean flag = ce.a(10);

			switch (i) {
			case -6:
				if (ce.a(11) && a == null) {
					az1 = b;
				} else {
					if (flag)
						az1 = c;
					else
						az1 = a;
				}
				break;
			case -5:
				az1 = b;
				break;
			case -7:
				if (flag)
					az1 = a;
				else
					az1 = c;
				break;
			}

			if (az1 != null) {
				short word0 = az1.M;

				if (word0 == 0 && ba1 != null)
					word0 = ba1.M;

				if (word0 != 0) {
					if (word0 == -1) {
						cd cd1 = k1.a(ba1);
						if (cd1 != null)
							cd1.a(aj1);
					} else {
						bh.b().a(k1, ba1, word0);
					}
					return true;
				}
			}
		}
		return false;
	}

	public final int u() {
		return bh.d.f / 7;
	}

	public final int g(int i) {
		return super.I.j.getHeight();
	}

	public final void d() {
		aj aj1 = (aj) super.H;
		k k1 = aj1.c;
		if (k1 == null) {
			a = null;
			c = null;
		} else {
			ba ba1 = aj1.b;
			boolean flag = ce.a(10);
			a = k1.b(ba1, flag ? 2 : 1);
			b = k1.b(ba1, 3);
			c = k1.b(ba1, flag ? 1 : 2);
			if (a != null)
				a.e = -1;
			if (b != null)
				b.e = -1;
			if (c != null)
				c.e = -1;
		}
		A();
	}

	public final void a(Graphics g1, bh bh1, o o1, int i, int j) {
		g1.setColor(o1.n);
		g1.setFont(o1.j);
		int l = o1.j.getHeight();
		if (!ce.a(11)) {
			int i1 = (35 * i) / 100;
			int j1 = i - 2 * i1;
			a(g1, a, 0, 0, i1, l, 20, true);
			a(g1, c, i - i1, 0, i1, l, 24, false);
			g1.setFont(o1.k);
			a(g1, b, i1, 0, j1, l, 17, true);
		} else {
			az az1;
			if (a == null)
				az1 = b;
			else
				az1 = a;

			az az2 = c;

			if (ce.a(28)) {
				az2 = az1;
				az1 = c;
			}

			a(g1, az1, 0, 0, i, l, 24, true);
			a(g1, az2, 0, j - l, i, l, 24, true);
		}
	}

	private static void a(Graphics g1, az az1, int i, int j, int l, int i1,
			int j1, boolean flag) {
		if (az1 != null) {
			u u1 = az1.c;
			if (u1 != null) {
				int k1 = u1.b();
				if (flag) {
					g1.drawImage(u1.a, i, j + i1 / 2, 6);
					i += k1;
				} else {
					g1.drawImage(u1.a, i + l, j + i1 / 2, 10);
				}
				l -= k1 + 2;
			}
			az1.e = bh.a(g1, az1.d, az1.e, l, i1, j1, i, j);
		}
	}

	public final boolean a(int i, int j, int l) {
		if (i == 1) {
			aj aj1 = (aj) H;
			boolean flag = ce.a(10);
			if (ce.a(11)) {
				int j1 = K.g / 2;
				if (l < j1) {
					if (flag)
						aj1.a(1, -7);
					else
						aj1.a(1, -6);
				} else if (l > j1) {
					if (flag)
						aj1.a(1, -6);
					else
						aj1.a(1, -7);
				}
			} else {
				int i1 = (35 * K.f) / 100;
				if (j < i1) {
					if (flag)
						aj1.a(1, -7);
					else
						aj1.a(1, -6);
				} else if (j > K.f - i1) {
					if (flag)
						aj1.a(1, -6);
					else
						aj1.a(1, -7);
				} else {
					aj1.a(1, -5);
				}
			}
		}
		return true;
	}
}